﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Property
{
    /// <summary>
    /// <para>Provides data for the <see langword="PropertyChanging">
    /// event.</see></para>
    /// </summary>
    public class PropertyIsChangingEventArgs : EventArgs
    {
        private readonly string propertyName;

        public PropertyIsChangingEventArgs(string propertyName)
        {
            this.propertyName = propertyName;
        }

        public virtual string PropertyName
        {
            get { return propertyName; }
        }
    }

    public delegate void PropertyChangingEventHandler(object sender, PropertyIsChangingEventArgs e);

    /// <summary>
    /// Defines an event for notifying clients that a property value is changing.
    /// </summary>
    public interface INotifyPropertyIsChanging
    {
        /// <summary>
        /// Occurs when a property value is changing.
        /// </summary>
        event PropertyChangingEventHandler PropertyChanging;
    }
}
